﻿using ServerFramework.Tools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HttpServer
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            Log.WriteLog(ELogLevel.LOG_INFO, "version:" + ConfigUtil.AppSetting("version"));
            Log.WriteLog(ELogLevel.LOG_INFO, "name:" + ConfigUtil.AppSetting("name"));
            ServerFramework.Net.Http.HttpServer server = new ServerFramework.Net.Http.HttpServer();
            server.AddRoute("/my",new MyRoute());
            server.AddRoute("/hello", new HelloRoute());
            server.StartServer("http://127.0.0.1:8080/");
            ///启动log线程
            Console.ResetColor();
            Log.Instance.StartLog(ConfigUtil.AppSetting("name"), "/Log");
            Log.WriteLog(ELogLevel.LOG_INFO, "server start success");
            Console.ReadLine();
        }
    }
}
